<template>
	<view class="viewBox">
		<view class="headerBox"> 
			<view class="header">
				<view class="information">
					<view>
						<view><text>会员</text>：{{userInfo.realName && userInfo.realName}} </view>
						<view><text>填写日期</text>：</view>
					</view>
					<view class="bottom">
						<view>签发人：{{list && list[0] && list[0].healthName}}</view>
						<view>签发日期：{{signData}}</view>
					</view>
				</view>
			</view>
			<view class="connectBox" v-show="!searchBarFixed">
				<image src="@/static/img/healthStatus/connect@2x.png"></image>
				<image src="@/static/img/healthStatus/connect@2x.png"></image>
			</view>
		</view>
		<view class="mainContent">
			<view class="item" v-for="(item,index) in list" :key="index">
				<view class="itemOne">
					<view>执行日期：{{item.createdDate}}</view>
					<view>主要内容：{{item.content}}</view>
				</view>
				<view class="itemTwo">
					<view class="title">具体事项：</view>
					<view class="content" v-html="item.specificMatters"></view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {getUrlParam,filterData2,age,distance} from '@/static/js/filter.js';
	export default{
		data(){
			return {
				list:[],
				userInfo:{},
				locaInfo:{},
				signData:'',
				searchBarFixed: false
			}
		},
		mounted(){
			const _this = this;
			const id = getUrlParam('id')
			this.locaInfo = JSON.parse(localStorage.userInfo)
			_this.$api.InterventionPlandetails(id).then((res)=>{
				_this.list = res.data.result;
				_this.signData = res.data.result && res.data.result.modifiedDate || res.data.result.createdDate
				_this.$api.findById(res.data.result.userId).then((ares)=>{
					_this.userInfo = ares.data.result;
				})
			})
		},
		onPageScroll() {
			this.searchBarFixed = this.distance('mainContent');
		},
		methods:{
			age,
			distance
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/static/css/monitor/interventionPlan/toView.scss';
</style>
